package com.scpii.universal.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.scpii.universal.hibernate.dao.BaseDao;
import com.scpii.universal.hibernate.entity.AttributeListTab;
import com.scpii.universal.hibernate.intface.BaseInterface;

public class AttributeListTabService implements BaseInterface<AttributeListTab> {
	private static final Logger log = LoggerFactory
			.getLogger(AttributeListTabService.class);
//	private BaseDao<AttributeListTab> attributeListTabDao = SpringBeanFactory.attributeListTabDao;
	private BaseDao<AttributeListTab> attributeListTabDao;

	public AttributeListTab get(Integer id) throws Exception {
		return attributeListTabDao.get(id);
	}

	public List<AttributeListTab> getAll() throws Exception {
		return attributeListTabDao.getAll();
	}

	public AttributeListTab get(String propertyName, Object value)
			throws Exception {
		return null;
	}

	public List<AttributeListTab> getList(String propertyName, Object value)
			throws Exception {
		return null;
	}

	public Long getTotalCount() throws Exception {
		return null;
	}

	public void save(AttributeListTab obj) throws Exception {

	}

	public void update(AttributeListTab obj) throws Exception {

	}

	public void delete(AttributeListTab obj) throws Exception {

	}

	public void delete(Integer id) throws Exception {

	}

	public List<AttributeListTab> hqlGetList(String hql,
			Map<String, Object> argsMap) throws Exception {
		return attributeListTabDao.hqlGetList(hql, argsMap);
	}

	public void hqlUpdate(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		attributeListTabDao.hqlUpdate(namedHqlQuery, argsMap);
	}

	public Long hqlGetNums(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		return attributeListTabDao.hqlGetNums(namedHqlQuery, argsMap);
	}

	public List<AttributeListTab> sqlGetList(String sqls,
			Map<String, Object> argsMap) throws Exception {
		return attributeListTabDao.sqlGetList(sqls, argsMap);
	}

	public void sqlUpdate(String sqls, Map<String, Object> argsMap)
			throws Exception {
		attributeListTabDao.sqlUpdate(sqls, argsMap);
	}

	public Long sqlGetNum(String sqls, Map<String, Object> argsMap)
			throws Exception {
		return attributeListTabDao.sqlGetNum(sqls, argsMap);
	}
	
	/**
	 * 根据类型获取选项
	 * @author Taylor
	 * 2012-9-20 上午10:52:58
	 * @param type
	 * @return
	 * @throws Exception
	 * List<AttributeListTab>
	 */
	public List<AttributeListTab> getOptionsByType(int type) throws Exception {
		List<AttributeListTab> attrList = new ArrayList<AttributeListTab>();
		Map<String, Object> argsMap = new HashMap<String, Object>();
		argsMap.put("intAttrType", type);
		attrList = this.hqlGetList("GET_OPTIONS_BY_TYPE", argsMap);
		if (attrList != null && attrList.size() > 0) {
			return attrList;
		}
		return null;
	}
	//Setter

	public void setAttributeListTabDao(BaseDao<AttributeListTab> attributeListTabDao) {
		this.attributeListTabDao = attributeListTabDao;
	}
	
}